package com.dangdang.action.authorize;

import com.dangdang.action.BaseAction;
import com.dangdang.service.AuthorizeService;
import com.dangdang.service.ServiceFactory;
import com.googlecode.jsonplugin.annotations.JSON;

/**
 * 邮箱验证
 * 
 * @author Wangpeihu
 * @team [Never give up]
 * @since JDK1.6(建议)
 * @date 2010-1-25
 */
public class ValidateEmailAction extends BaseAction {
	private String email;

	private boolean ok;

	private final AuthorizeService us = ServiceFactory.getAuthorizeService();

	public boolean isOk() {
		return ok;
	}

	public void setOk(boolean ok) {
		this.ok = ok;
	}

	@JSON(serialize = false)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String execute() throws Exception {
		ok = us.validateEmail(email);
		return "success";
	}

}
